Skip to content

feat: replace Node services with Python apps and add balena-friendly …#43

Open
samuel-duffield1 wants to merge 2 commits into
balena-io-examples:masterfrom
samuel-duffield1:update_and_orchestrate
Open

feat: replace Node services with Python apps and add balena-friendly …#43
samuel-duffield1 wants to merge 2 commits into
balena-io-examples:masterfrom
samuel-duffield1:update_and_orchestrate

Conversation

@samuel-duffield1

Copy link
Copy Markdown

Summary

This replaces the example's Node-based data and frontend services with minimal Python applications and adds balena-friendly container startup orchestration.

What changed

  • replaced the data service with a simple Python API that reports CPU usage
  • replaced the frontend service with a simple Streamlit dashboard that graphs CPU usage
  • switched the Python containers from balenalib bases to standard Docker Hub Python images
  • used uv for Python dependency installation and runtime startup
  • added shared flock-based startup scripts so services can wait on dependencies without depends_on
  • simplified HAProxy routing to serve the Streamlit frontend
  • updated the README to use balena push instead of the older git remote workflow

Why

Healthchecks are not supported on balenaOS

Implementation notes

  • each Python service is intentionally kept minimal: a single app.py, requirements.txt, and startup script
  • service readiness is coordinated through lock files on a shared named volume
  • the proxy waits for the frontend lock, and the frontend waits for the data lock

Testing

  • validated the updated compose configuration
  • verified the frontend fix for Streamlit chart input by switching to stable DataFrame-backed chart data
  • deployed with balena push during verification

…startup locks

- replace the data service with a minimal Python CPU usage API
- replace the frontend with a simple Streamlit CPU usage dashboard
- switch balenalib images to standard Docker Hub Python bases with uv
- add shared flock-based startup orchestration for balena multicontainer readiness
- simplify HAProxy routing for the Streamlit frontend
- update README deployment instructions to use balena push

Change-type: patch
Signed-off-by: Sam Duffield <sam.duffield@balena.io>
Change-type: patch
Signed-off-by: Sam Duffield <sam.duffield@balena.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant